<!DOCTYPE html>
<html>
	
	<head>
		<meta charset="utf-8">
		<title>layui</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
		<link rel="stylesheet" type="text/css" href="/static/manage/common/bootstrap/js/bootstarp-3.3.7/css/bootstrap.min.css" />
		<script src="/static/manage/common/bootstrap/js/jquery-3.2.0.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="/static/manage/common/bootstrap/js/bootstarp-3.3.7/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="/static/manage/common/bootstrap/js/bootstarp-table-1.11.1/bootstrap-table.min.css" />
		<script src="/static/manage/common/bootstrap/js/bootstarp-table-1.11.1/bootstrap-table.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="/static/manage/common/bootstrap/js/bootstarp-table-1.11.1/bootstrap-table-zh-CN.min.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<style>
		
		#ts{
			padding-top: 50px;
		}
		
	</style>
	<body>
		<form class="form-inline">
			<div class="form-group">
			手机号：<input type="text" class="form-control" id="mobile" name="bisCustomUser.mobile" placeholder="手机号">
			</div>
			<div class="form-group">
			姓名：<input type="text" class="form-control" id="username" name="bisCustomUser.username" placeholder="姓名">
			</div>                             
			<div class="form-group">
   			店铺名称： <select class="form-control" id="shop_name" name="bisShop.shop_name">
  			<option  value="">--------------------------------</option>
  			</select>
  		   </div>
  		    <div class="form-group">
  			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注册方式：<select class="form-control" id="enroll_mode" name="bisCustomUser.enroll_mode">
  			<option  value="">--------------------------------</option>
  			<option  value="1">微信</option>
  			<option  value="2">商家</option>
  			<option  value="3">后台</option>
  			</select>
  		    </div>
			<div class="form-group">
			会员号：<input type="text" class="form-control" id="custom_user_id" name="bisCustomUser.custom_user_id" placeholder="会员号">
			</div>
			<div class="form-group">
			昵称：<input type="text" class="form-control" id="nikename" name="bisCustomUser.nikename" placeholder="昵称">
			</div>
			<div class="form-group">
  			微信状态：<select class="form-control" id="wechat_status" name="bisCustomUser.wechat_status">
  			<option  value="">--------------------------------</option>
  			<option  value="1">未订阅</option>
  			<option  value="2">已订阅</option>
  			<option  value="3">已退订</option>
  			</select>
  		    </div>
  		    <div class="form-group">
  			最近到店时间：<select class="form-control" id="day" name="day">
  			<option  value="">--------------------------------</option>
  			<option  value="30">一个月未到店</option>
  			<option  value="60">两个月未到店</option>
  			<option  value="90">三个月未到店</option>
  			
  			</select>
  		    </div>
			
		</form>
		<br />
  		    <button class="btn btn-primary" id="btn1">查询</button>
  		    <button class="btn btn-info" id="btn2">重置</button>
				&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
			<button type="button" class="btn btn-success" data-toggle="modal" data-target="#myModal">
			<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&nbsp;添加</button>
			
			<table id="table">

			</table>
				
		
      <!-- 添加Modal -->
		<form id="fm" action="/bc/add" method="post"  enctype="multipart/form-data">
		<div class="modal fade bs-example-modal-lg" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
        	<table class="table table-bordered">
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">手机:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="mobile1" name="mobile" placeholder="">
 				 	</td>
 				 	
 				 	<td align="right">
 				 		<label for="accountT">头像:</label>
 				 	</td>
 				 	<td>
 				 		<input type="file" class="form-control" id="photo1" name="file" />
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">姓名:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="username1" name="username" placeholder="">
 				 	</td>
 				 	<td align="right">
 				 		<label for="accountT">性别:</label>
 				 	</td>
 				 	<td>
 				 		<select class="form-control" id="sex1" name="sex">
 				 			<option>男</option>
 				 			<option>女</option>
 				 		</select>
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">昵称:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="nikename1" name="nikename" placeholder="">
 				 	</td>
 				 	<td align="right">
 				 		<label for="accountT">出生日期:</label>
 				 	</td>
 				 	<td>
 				 		<input type="date"class="form-control" id="born_date1" name="born_date" placeholder="">
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">电话:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="phone1" name="phone" placeholder="">
 				 	</td>
 				 	<td align="right">
 				 		<label for="accountT">QQ:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="qq1" name="qq" placeholder="">
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">邮箱:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="email1" name="email" placeholder="">
 				 	</td>
 				 	<td align="right">
 				 		<label for="accountT">通信地址:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="address1" name="address" placeholder="">
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td id="ts">
 				 		<label for="accountT">微信标识号:</label>
 				 	</td>
 				 	<td id="ts">
 				 		<input type="text" class="form-control" id="openid1" name="openid" placeholder="">
 				 	</td>
 				 	<td id="ts">
 				 		<label for="accountT">备注:</label>
 				 	</td>
 				 	<td >
 				 		<textarea cols="60" id="remark1" name="remark" rows="5" wrap="hard"></textarea>
 				 	</td>
 				 	
 				 </tr>
			</table>
      	<div class="modal-footer">
        		<button type="button" class="btn btn-default" data-dismiss="modal">关闭<tton>
       			<button type="button" class="btn btn-primary" id="addbtn2">保存<tton>
      		</div>
    </div>
  </div>
</div>
		</form>
		
      	<!-- 修改Modal -->
		<form id="fm2" action="/bc/updateType" method="post"  enctype="multipart/form-data">
		<div class="modal fade bs-example-modal-lg" id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-lg" role="document">
        	
        <div class="modal-content">
        	<table class="table table-bordered">
 				 <tr height="70px" >
 				 	<td>
 				 		<label >手机:</label>
 				 	</td>
 				 	<td>
 				 		<input type="hidden" class="form-control" id="custom_user_id2" name="custom_user_id" >
 				 		<input type="text" class="form-control" id="mobile2" name="mobile" placeholder="" align="center">
 				 	</td>
 				 	<td align="right">
 				 		<label for="accountT">头像:</label>
 				 	</td>
 				 	<td>
 				 		<span class=""><img src="" id="photo3" width="70" height="70" /> </span>
 				 		<input type="file" class="form-control" id="photo2" name="file">
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">姓名:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="username2" name="username" placeholder="">
 				 	</td>
 				 	<td align="right">
 				 		<label for="accountT">性别:</label>
 				 	</td>
 				 	<td>
 				 		<select class="form-control" id="sex2" name="sex">
 				 			<option id="nan">男</option>
 				 			<option id="nv">女</option>
 				 		</select>
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">昵称:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="nikename2" name="nikename" placeholder="">
 				 	</td>
 				 	<td align="right">
 				 		<label for="accountT">出生日期:</label>
 				 	</td>
 				 	<td>
 				 		<input type="date" class="form-control" id="born_date2" name="born_date" placeholder="">
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">电话:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="phone2" name="phone" placeholder="">
 				 	</td>
 				 	<td align="right">
 				 		<label for="accountT">QQ:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="qq2" name="qq" placeholder="">
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">邮箱:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="email2" name="email"placeholder="">
 				 	</td>
 				 	<td align="right">
 				 		<label for="accountT">通信地址:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control"  id="address2" name="address" placeholder="">
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">备注:</label>
 				 	</td>
 				 	<td colspan="3">
 				 		<textarea cols="115" rows="5" wrap="hard" id="remark2" name="remark"></textarea>
 				 	</td>
 				 	
 				 </tr>
			</table>
      		<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary" id="updatebtn2">保存</button>
			</div>
    </div>
  </div>
</div>
		</form>
		
		
		<!-- 查看详情 (基本信息) Modal -->
		<form id="fm3">
		<div class="modal fade bs-example-modal-lg" id="myModal3" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
        	<table class="table table-bordered">
 				 <tr height="70px" >
 				 	<td>
 				 		<label >手机:</label>
 				 	</td>
 				 	<td>
 				 		<input type="hidden" class="form-control" id="custom_user_id3" name="custom_user_id" >
 				 		<input type="text" class="form-control" id="mobile3" name="mobile" placeholder="" align="center">
 				 	</td>
 				 	<td align="right">
 				 		<label for="accountT">头像:</label>
 				 	</td>
 				 	<td>
 				 		<span class=""><img src="" id="photo5" width="140" height="100" /> </span>
 				 		
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">姓名:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="username3" name="username" placeholder="">
 				 	</td>
 				 	<td align="right">
 				 		<label for="accountT">性别:</label>
 				 	</td>
 				 	<td>
 				 		<select class="form-control" id="sex3" name="sex">
 				 			<option id="nan">男</option>
 				 			<option id="nv">女</option>
 				 		</select>
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">昵称:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="nikename3" name="nikename" placeholder="">
 				 	</td>
 				 	<td align="right">
 				 		<label for="accountT">出生日期:</label>
 				 	</td>
 				 	<td>
 				 		<input type="date" class="form-control" id="born_date3" name="born_date" placeholder="">
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">电话:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="phone3" name="phone" placeholder="">
 				 	</td>
 				 	<td align="right">
 				 		<label for="accountT">QQ:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="qq3" name="qq" placeholder="">
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">邮箱:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control" id="email3" name="email"placeholder="">
 				 	</td>
 				 	<td align="right">
 				 		<label for="accountT">通信地址:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control"  id="address3" name="address" placeholder="">
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td>
 				 		<label for="accountT">微信标识号:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control"  id="openid3" name="openid">
 				 	</td>
 				 	<td>
 				 		<label for="accountT">微信状态:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control"  id="wechat_status1" name="wechat_status">
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td>
 				 		<label for="accountT">注册方式:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control"  id="enroll_mode1" name="enroll_mode">
 				 	</td>
 				 	<td>
 				 		<label for="accountT">注册时间:</label>
 				 	</td>
 				 	<td>
 				 		<input type="text" class="form-control"  id="enroll_time1" name="enroll_time">
 				 	</td>
 				 </tr>
 				 <tr>
 				 	<td align="right">
 				 		<label for="accountT">备注:</label>
 				 	</td>
 				 	<td colspan="3">
 				 		<input type="text"  class="form-control"  id="remark3" name="remark"/>
 				 	</td>
 				 	
 				 </tr>
			</table>
      		<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<!--<button type="button" class="btn btn-primary" id="updatebtn2">保存</button>-->
			</div>
    </div>
  </div>
</div>
		</form>

	</body>

	<script type="text/javascript">
		
		$(function() {

			//1.初始化Table

			var oTable = new TableInit();

			oTable.Init();

			var message = document.getElementById("message").value;

			if(message != null && message != "") {

				alert(message);

			}
		});

		var TableInit = function() {
			var oTableInit = new Object();
			//初始化Table
			oTableInit.Init = function() {

				$('#table').bootstrapTable({

					method: 'get',

					contentType: "application/json",

					url: "/bc/list", //请求后台的URL（*）

					striped: true, //是否显示行间隔色

					locale: 'zh-CN', //中文支持

					pagination: true, //是否开启分页（*）

					pageNumber: 1, //初始化加载第一页，默认第一页

					pageSize: 7, //每页的记录行数（*）

					pageList: [3, 5, 7, 9], //可供选择的每页的行数（*）

					sidePagination: "server", //分页方式：client客户端分页，server服务端分页（*）

					showRefresh: true, //刷新按钮

					queryParams: oTableInit.queryParams, //传递参数（*）

					strictSearch: true,

					showColumns: true, //是否显示所有的列

					showRefresh: true, //是否显示刷新按钮

					minimumCountColumns: 2, //最少允许的列数

					clickToSelect: true, //是否启用点击选中行

					uniqueId: "custom_user_id", //每一行的唯一标识，一般为主键列

					columns: [{
								field: 'bisCustomUser.photo',
								title: '头像',
								align: 'center',
								formatter: function(value, row, index) {
										return '<img  src="' + row.bisCustomUser.photo+ '" height="70px" width="70px" >';
									}
							}, {
								field: 'bisCustomUser.custom_user_id',
								title: '会员号',
								align: 'center',
								valign:'middle',
							}, {
								field: 'bisCustomUser.mobile',
								title: '手机',
								align: 'center',
								valign:'middle',
							}, {
								field: 'bisCustomUser.username',
								title: '姓名',
								align: 'center',
								valign:'middle',
							}, {
								field: 'bisCustomUser.nikename',
								title: '昵称',
								align: 'center',
								valign:'middle',
							}, {
								field: 'bisCustomUser.sex',
								title: '性别',
								align: 'center',
								valign:'middle',
							}, {
								field: 'bisShop.shop_name',
								title: '店铺名称',
								align: 'center',
								valign:'middle',
							}, {
								field: 'bisCustomUser.wechat_status',
								title: '微信状态',
								align: 'center',
								valign:'middle',
								formatter:function(v,r,i){
								switch (Number(v)){
									case 1:
										return "未订阅";
										break;
									case 2:
										return "已订阅";
										break;
									case 3:
										return "已退订";
										break;
								}
							}
							}, {
								field: 'bisCustomUser.qq',
								title: 'QQ',
								align: 'center',
								valign:'middle',
							}, {
								field: 'bisCustomUser.email',
								title: '邮箱',
								align: 'center',
								valign:'middle',
							}, {
								field: 'bisCustomUser.born_date',
								title: '出生日期',
								align: 'center',
								valign:'middle',
								//获取日期列的值进行转换
							formatter: function(value, row, index) {
							return changeDateFormat(value)
						}
							}, {
								field: 'recent_time',
								title: '最近到店时间',
								align: 'center',
								valign:'middle',
								//获取日期列的值进行转换
							formatter: function(value, row, index) {
							return changeDateFormat(value)
						}
							}, {
								field: 'bisCustomUser.enroll_mode',
								title: '注册方式',
								align: 'center',
								valign:'middle',
								formatter:function(v,r,i){
								switch (Number(v)){
									case 1:
										return "微信";
										break;
									case 2:
										return "商家";
										break;
									case 3:
										return "后台";
										break;
								}
							}
							}, {
						field: 'cz',
						title: '操作',
						width: '200px',
						align: 'center',
						formatter: function(value, row, index) {
					return '<button class="btn btn-warning" data-toggle="modal" data-target="#myModal2" onclick="findByTypeId(' + row.bisCustomUser.custom_user_id + ')">修改<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></button>' 
							+'&nbsp&nbsp'+ 
							'<button onclick="deleteType(' + row.bisCustomUser.custom_user_id + ')" class="btn btn-danger">删除<span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>'
							+'&nbsp&nbsp'+ 
							'<button class="btn btn-warning" data-toggle="modal" data-target="#myModal3" onclick="findCustomerById(' + row.bisCustomUser.custom_user_id + ')" class="btn btn-info">查看详情<span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>'
						}

					}]


				});

			};
			//得到查询的参数

			oTableInit.queryParams = function(params) {

				var temp = { //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的

					//偏移量
					offset: params.offset,
					//每页多少条数据
					pageSize: params.limit,
//					//页面大小
//					limit: params.limit, 
					
					custom_user_id: $("#custom_user_id").val(),
					mobile: $("#mobile").val(),
					username: $("#username").val(),
					nikename: $("#nikename").val(),
					shop_name: $("#shop_name").val(),
					wechat_status: $("#wechat_status").val(),
					enroll_mode: $("#enroll_mode").val(),
					recent_time: $("#recent_time").val(),
					day: $("#day").val()
				};
				return temp;
			};
			return oTableInit;
		};
		
		// 店铺名称下拉框
			 	$.ajax({
				type: "get",
				url: "/bc/select1" ,
				success: function(data) {
					var items = data.rows;
					console.log('======='+items);
					for(i = 0; i < items.length; i++) {
						$("#shop_name").append("<option value='" + items[i].shop_name+ "'>" + items[i].shop_name + "</option>");
					}
				}
			}) 
		// 最近到店时间
			 /*	$.ajax({
				type: "get",
				url: "/bc/select2" ,
				success: function(data) {
					var items = data.rows;
					console.log('======='+items);
					for(i = 0; i < items.length; i++) {
						
						$("#recent_time").append("<option value='" +changeDateFormat(items[i].recent_time) + "'>" + changeDateFormat(items[i].recent_time)+ "</option>");
					}
				}
			}) */
		/*// 注册方式    微信状态 下拉框
			 	$.ajax({
				type: "get",
				url: "/bc/select3" ,
				success: function(data) {
					var items = data.rows;
					console.log('======='+items);
					for(i = 0; i < items.length; i++) {
						$("#enroll_mode").append("<option value='" + items[i].enroll_mode + "'>" + items[i].enroll_mode + "</option>");
						$("#wechat_status").append("<option value='" +  items[i].wechat_status+ "'>" + items[i].wechat_status + "</option>");
					}
				}
			}) */
		
		//列表显示
		$('#btn1').click(function(){
			
			$('#table').bootstrapTable('refresh', {
				url:'/bc/list'
			});
		})
	
		//重置
		$('#btn2').off().on("click",function(){
			$("#custom_user_id").val("");
			$("#mobile").val("");
			$("#username").val("");
			$("#nikename").val("");
			$("#shop_name").val("");
			$("#wechat_status").val("");
			$("#enroll_mode").val("");
			$("#recent_time").val("");
			$("#day").val("");
		})
	
		//转换日期格式(时间戳转换为datetime格式)
		function changeDateFormat(cellval) {
			var dateVal = cellval + "";
			if(cellval != null) {
				var date = new Date(parseInt(dateVal.replace("/Date(", "").replace(")/", ""), 10));
				var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
				var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();

//				var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
//				var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
//				var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
//				+ " " + hours + ":" + minutes + ":" + seconds

				return date.getFullYear() + "-" + month + "-" + currentDate ;
			}
		}
		
		//添加
		$("#addbtn2").click(function () {
//			$.ajax({
//				type:"post",
//				url:"/bc/add",
//				data:$("#fm").serialize(),
//				success: function(data) {
//					alert('data='+$("#fm").serialize());
//					$("#fm").submit();
//					$("#myModal").modal("hide")
//					$("#table").bootstrapTable('refresh');
//				}
//		  	 });
			$("#fm").submit();
			$("#myModal").modal("hide");
		})
		
		//删除
		function deleteType(custom_user_id){
			$.ajax({
				type:"post",
				url:"/bc/deleteType/"+custom_user_id,
				success: function (data) {
					$("#table").bootstrapTable('refresh');
				}
			});
		}
		
		//根据ID取值
		function findByTypeId(custom_user_id){
			$.ajax({
				type:"post",
				url:"/bc/findByTypeId/"+custom_user_id,
				success: function (data) {
					
					$("#custom_user_id2").val(data.custom_user_id);
					$("#mobile2").val(data.mobile);
					$("#photo3").attr("src",data.photo);
					$("#photo3").val(data.photo);
					$("#username2").val(data.username);
					$("#sex2").val(data.sex);
					$("#nikename2").val(data.nikename);
					$("#born_date2").val(changeDateFormat(data.born_date));
					$("#phone2").val(data.phone);
					$("#qq2").val(data.qq);
					$("#email2").val(data.email);
					$("#address2").val(data.address);
					$("#remark2").val(data.remark);
					
				}
			});
		}
		
		//根据ID查看基本信息
		function findCustomerById(custom_user_id){
			$.ajax({
				type:"post",
				url:"/bc/findCustomerById/"+custom_user_id,
				success: function (data) {
					
					$("#custom_user_id3").val(data.custom_user_id);
					$("#mobile3").val(data.mobile);
					$("#photo5").attr("src",data.photo);
					$("#username3").val(data.username);
					$("#sex3").val(data.sex);
					$("#nikename3").val(data.nikename);
					$("#born_date3").val(data.born_date);
					$("#phone3").val(data.phone);
					$("#qq3").val(data.qq);
					$("#email3").val(data.email);
					$("#address3").val(data.address);
					alert(data.openid+"=="+data.remark);
					$("#openid3").val(data.openid);
					$("#wechat_status1").val(data.wechat_status);
					$("#enroll_mode1").val(data.enroll_mode);
					$("#enroll_time1").val(changeDateFormat(data.enroll_time));
					
					$("#remark3").val(data.remark);
					
				}
			});
		}
		
		//修改
		$("#updatebtn2").click(function () {
			/*$.ajax({
				type:"post",
				url:"/bc/updateType",
				data:{
					custom_user_id:$("#custom_user_id2").val(),
					mobile:$("#mobile2").val(),
					photo:$("#photo2").val(),
					username:$("#username2").val(),
					photo:$("#photo2").val(),
					sex:$("#sex2").val(),
					nikename:$("#nikename2").val(),
					born_date:$("#born_date2").val(),
					phone:$("#phone2").val(),
					qq:$("#qq2").val(),
					email:$("#email2").val(),
					address:$("#address2").val(),
					remark:$("#remark2").val()
				},
				success: function (data) {
					$("#myModal2").modal("hide")
					$("#table").bootstrapTable('refresh');
				}
			});
*/
           $("#fm2").submit();
		$("#myModal2").modal("hide")
		})
		
	</script>

</html>